import React, { useRef, useState } from 'react'
import { DatetimePicker, Field } from 'react-vant'
export default function Index(props) {
    const { UserInfoDate } = props
    const [value, setValue] = React.useState(new Date())
    const ref = useRef(null)
    console.log(UserInfoDate);
    return (
        <div>
            <div className='userinfo_update_box'>
                <div className='userinfo_update_box2'>
                    <div className='userinfo_update_box_left'>
                        <p>生日</p>
                    </div>
                    <div className='userinfo_update_box_right'>
                        <DatetimePicker
                            popup={{
                                round: true,
                            }}
                            type='date'
                            // title='选择年月日'
                            minDate={new Date(1900, 0, 1)}
                            maxDate={new Date(2025, 10, 1)}
                            value={value}
                            onConfirm={setValue}
                            
                        >
                            {(val, _, actions) => {
                                return (
                                    <Field
                                        // placeholder='2022-02-03'
                                        // clickable
                                        // label='选择年月日'
                                        value={val.toLocaleDateString()}
                                        placeholder='请选择日期'
                                        onClick={(e) => {
                                            
                                            actions.open()
                                        }}
                                    />
                                )
                            }}
                        </DatetimePicker>

                    </div>
                </div>

            </div>
           
            <div>

            </div>
        </div>
    )
}
